/**
 * Created by Administrator on 2018/5/6/006.
 */
var $ = jQuery;
function jQuery(selector) {
    return new jQuery.fn.init(selector)
}
var $ = jQuery;
jQuery.fn = jQuery.prototype;
jQuery.prototype.init = function(selector){
    if(typeof selector == "object"){
        var arr =[];
        arr.push.call(this,selector);
    }else if(typeof selector == "string"){
        Sizzle(selector,document,this)
    }
    return this;
};

jQuery.prototype.init.prototype = jQuery.fn;

jQuery.fn.on = function(type,callback){
    var nodes = Array.from(this)
    nodes.forEach(function (val) {
        val.addEventListener(type,function () {
            callback.call(this);
        })
    });
    return this;
};
jQuery.fn.css = function (attr,val) {
    var nodes = Array.from(this);
    nodes.forEach(function (v) {
        console.log(v);
        v.style[attr] = val;
    });
    return this;
};
jQuery.fn.attr = function (){

}
//下面全是扩展方法。。。


